package org.opens.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping(value = "/log")
@Slf4j
public class LogController {

    @RequestMapping(value = "/one")
    public Map<String, Object> getOneLog() {
        Map<String, Object> result = new HashMap<>();
        result.put("code", 200);
        int i = 0;
        while (i < 5) {
            log.info("controller info " + i++);
            log.debug("controller debug " + i++);
            log.error("controller error " + i++);
        }
        return result;
    }

}
